cat >/etc/sysctl.conf <<-EOF
net.ipv4.ip_forward = 1
net.ipv4.ip_local_port_range = 1024  65535
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_synack_retries = 1
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_max_tw_buckets = 262144
net.ipv4.tcp_max_orphans = 3276800
net.ipv4.tcp_max_syn_backlog = 16384
net.core.somaxconn = 16384
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.tcp_keepalive_probes = 3
net.ipv4.tcp_keepalive_time = 1200
net.core.netdev_max_backlog = 500000
net.core.rmem_default = 8388608
net.core.wmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_wmem = 4096   16384   16777216
net.ipv4.tcp_thin_dupack = 1
net.ipv4.tcp_thin_linear_timeouts = 1
net.unix.max_dgram_qlen = 30000
net.nf_conntrack_max = 2000000
net.netfilter.nf_conntrack_max =2000000
net.netfilter.nf_conntrack_tcp_timeout_established = 600
net.netfilter.nf_conntrack_tcp_timeout_fin_wait=30
net.netfilter.nf_conntrack_tcp_timeout_time_wait=30
net.netfilter.nf_conntrack_tcp_timeout_close_wait=15
kernel.panic = 1
kernel.sysrq = 0
kernel.randomize_va_space = 1
kernel.core_pattern = /home/corefiles/core-%e-%p-%t
vm.min_free_kbytes=901120
vm.panic_on_oom=1
vm.min_free_kbytes=1048576
vm.swappiness=20
fs.inotify.max_user_instances=8192
fs.inotify.max_user_watches=8192000
fs.aio-max-nr=1048576
fs.file-max = 1048575
EOF
sysctl -p
